package com.fire.market.order.tcc;

import com.fire.market.order.api.request.OrderCreateParam;
import io.seata.rm.tcc.TwoPhaseResult;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * OrderCreateTcc
 *
 * @author zwd
 * @date 2021/7/24
 * @desc
 */
@LocalTCC
public interface StockDecreaseTcc {
    @TwoPhaseBusinessAction(name = "orderCreateTcc", commitMethod = "commit", rollbackMethod = "rollback")
    public TwoPhaseResult prepare(@BusinessActionContextParameter(paramName = "OrderCreateParam") OrderCreateParam param);

    public TwoPhaseResult commit(BusinessActionContext actionContext);

    public TwoPhaseResult rollback(BusinessActionContext actionContext);
}
